package com.tuanzi.webtalk.service.impl;

import com.tuanzi.webtalk.dao.UserMapper;
import com.tuanzi.webtalk.domain.User;
import com.tuanzi.webtalk.service.LoginService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 雄关漫道真如铁，而今迈过从头越
 **/

@Service
public class LoginServiceImpl implements LoginService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User login(String username, String password) {
        User user = userMapper.selectByUsername(username);
        if (user.getPassword().equals(password)){
            return user;
        }

        return null;
    }
}
